package com.taysear.parcel.domain;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@SuppressWarnings("serial")
@Entity
@Table(name = "role_permission")
public class RolePermission implements Serializable{

	@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer rolePermissionId;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name = "permission")
	private Permission permission;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name = "role", insertable=true, updatable=false)
	private Role role;
	
	public Integer getRolePermissionId() {
		return rolePermissionId;
	}
	public void setRolePermissionId(Integer rolePermissionId) {
		this.rolePermissionId = rolePermissionId;
	}
	public Permission getPermission() {
		return permission;
	}
	public void setPermission(Permission permission) {
		this.permission = permission;
	}
	public Role getRole() {
		return role;
	}
	public void setRole(Role role) {
		this.role = role;
	}
	
}
